@extends('layouts.appManager')


@section('script')
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                a: 1,
                imageServer:2,
                version:0,
            },
            created: function () {
                // `this` 指向 vm 实例
                console.log('a is: ' + this.a)
            }
        })
    </script>
@endsection

@section('content')
    <div class="container py-5">
        <div class="row justify-content-center">
            <div class="col-md-8">
                <form method="POST" action="{{ route('server_v2.store2') }}">
                    @csrf
                    <div class="card panel">
                        <div class="card-header">基本信息配置</div>

                        <div class="card-body">

                            <div class="form-group row">
                                <label for="name" class="col-md-4 col-form-label text-md-right">服务器名称 <span class="text-danger">*</span></label>

                                <div class="col-md-6">
                                    <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" autocomplete="name" autofocus maxlength="20" required>

                                    @error('name')
                                    <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="form-group row">



                                <label for="domain" class="col-md-4 col-form-label text-md-right">域名 <span class="text-danger">*</span></label>

                                <div class="col-md-6">

                                    <div class="input-group">
                                        <div class="input-group-prepend is-invalid ">
                                            <span class="input-group-text">http://</span>
                                        </div>
                                        <input id="domain" type="text" class="form-control @error('domain') is-invalid @enderror" name="domain" value="{{ old('domain') }}" autocomplete="domain" maxlength="10" required>
                                        <div class="input-group-append is-invalid ">
                                            <span class="input-group-text" >.{{config('conf.domain')}}</span>
                                        </div>
                                        @error('domain')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>
                                    {{--<input id="domain" type="text" class="form-control @error('domain') is-invalid @enderror" name="domain" value="{{ old('domain') }}" autocomplete="domain">--}}

                                    <small class="text-secondary"> <i class="fas fa-info-circle"></i> 玩家访问的域名，不可修改，谨慎填写</small>
                                </div>

                            </div>

                            <div class="form-group row">
                                <label for="info" class="col-md-4 col-form-label text-md-right">服务端介绍</label>

                                <div class="col-md-6">
                                    <textarea id="info" rows="5" class="form-control @error('info') is-invalid @enderror" name="info" autocomplete="info">{{ old('info') }}</textarea>

                                    @error('info')
                                    <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="form-group row">
                                <label for="qq_group" class="col-md-4 col-form-label text-md-right">QQ群</label>

                                <div class="col-md-6">
                                    <input id="qq_group" type="text" class="form-control @error('qq_group') is-invalid @enderror" name="qq_group" value="{{ old('qq_group') }}" autocomplete="qq_group">

                                    @error('qq_group')
                                    <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="form-group row">
                                <label for="qq_group" class="col-md-4 col-form-label text-md-right">客服QQ</label>

                                <div class="col-md-6">
                                    <input id="qq_server" type="text" class="form-control @error('qq_server') is-invalid @enderror" name="qq_server" value="{{ old('qq_server') }}" autocomplete="qq_server">

                                    @error('qq_server')
                                    <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="card panel">
                        <div class="card-header">服务器配置</div>
                        <small class="text-secondary mt-3"> <i class="fas fa-info-circle"></i>  <a href="http://idc.ownserver.online/choose" target="_blank">欧赛云</a>，选择AZ测试版(NPC机器人版)。客服QQ：572815673</small>
                        <small class="text-secondary mt-3"> <i class="fas fa-info-circle"></i>  <a href="http://www.eltyun.com" target="_blank">旅途云</a>，客服QQ：80071052 </small>
                        <small class="text-secondary mt-3"> <i class="fas fa-info-circle"></i>  <a href="http://www.yxtidc.com" target="_blank">亿信通科技</a>，客服QQ：7409986 【筹备中】</small>
                        <div class="card-body">

                            {{--<div class="form-group row">
                                <label for="server_host" class="col-md-4 col-form-label text-md-right">镜像提供商 <span class="text-danger">*</span></label>
                                <div class="col-md-6">
                                    <select class="form-control" v-model="imageServer">
                                        <option :value="1">欧赛云</option>
                                        <option :value="2">亿信通科技</option>
                                    </select>
                                </div>
                            </div>--}}

                            <div class="form-group row">
                                <label for="server_host" class="col-md-4 col-form-label text-md-right">镜像服务端版本 <span class="text-danger">*</span></label>
                                <div class="col-md-6">
                                    <select class="form-control" name="version" v-model="version">
                                        <option :value="0">原版</option>
                                        <option :value="2">NPC机器人版</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label for="server_host" class="col-md-4 col-form-label text-md-right">服务器IP <span class="text-danger">*</span></label>
                                <div class="col-md-6">
                                    <input id="server_host" type="text" class="form-control @error('server_host') is-invalid @enderror" name="server_host" value="{{ old('server_host') }}" autocomplete="server_host" maxlength="20" required>

                                    @error('server_host')
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $message }}</strong>
                                    </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="form-group row" v-if="imageServer!==1">
                                <label for="root_pwd" class="col-md-4 col-form-label text-md-right">root用户密码 <span class="text-danger">*</span></label>

                                <div class="col-md-6">
                                    <input id="root_pwd" type="password"  class="form-control @error('root_pwd') is-invalid @enderror" name="root_pwd" value="{{ old('root_pwd') }}" autocomplete="root_pwd" maxlength="20" required>

                                    @error('root_pwd')
                                    <span class="invalid-feedback" role="alert">
                                                <strong>{{ $message }}</strong>
                                            </span>
                                    @enderror

{{--                                    <small class="text-secondary mt-3"> <i class="fas fa-info-circle"></i> 如果密码未修改，请使用当前默认的密码</small>--}}
                                </div>
                            </div>



                        </div>
                    </div>


                    <div class="col-md-6 offset-md-3">
                        <button type="submit" class="btn btn-primary btn-block">
                            添加
                        </button>
                    </div>

                </form>
            </div>
        </div>
    </div>
@endsection


